package com.tzbank.wisdom.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.tzbank.wisdom.service.OtherCardRegisterService;
import com.tzbank.wisdom.service.SysSettingService;
import com.tzbank.wisdom.service.TzbCardRegisterService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 注冊
 * zhangzehuan
 */
@Api(tags = {"注册"})
@RequestMapping("register")
@RestController
public class RegisterController {
    @Autowired
    private TzbCardRegisterService tzbCardRegisterService;
    @Autowired
    private OtherCardRegisterService otherCardRegisterService;
    @Autowired
    private SysSettingService sysSettingService;
    /**
     * 本行卡注册
     *
     * @param
     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/saveUserRegisterInfo")
    @ApiOperation(value = "本行卡注册", notes = "本行卡注册接口")
    public Map<String, Object> saveUserRegisterInfo(@RequestBody Map<String, String> reqBody) {
        return tzbCardRegisterService.tzbCardReg(reqBody);
    }


    /**
     * 他行卡注册
     *
     * @param
     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/saveOtherUserRegisterInfo")
    @ApiOperation(value = "他行卡注册", notes = "他行卡注册接口")
    public Map<String, Object> saveOtherUserRegisterInfo(@RequestBody Map<String, String> reqBody) {
        return otherCardRegisterService.otherCardReg(reqBody);
    }

    /**
     * 发送短信验证码
     *
     * @param
     * @param reqBody
     * @return
     */
    @ResponseBody
    @PostMapping(value = "/getRegisterCode")
    @ApiOperation(value = "发送短信验证码", notes = "发送短信验证码接口")
    public Map<String, Object> getRegisterCode(@RequestBody Map<String, String> reqBody) {
        return otherCardRegisterService.sendAuthCode(reqBody);
    }
    
    
    /**
     * 身份联网核查
     */
    @PostMapping(value="/cardValidate")
    @ResponseBody
    @ApiOperation(value="身份联网核查",notes="身份联网核查接口")
    public Map<String,Object> cardValidate(@RequestBody Map<String,String> reqBody){
    	return sysSettingService.cardValidate(reqBody);
    }
    

}
